package com.example.use;

import android.database.ContentObserver;
import android.net.wifi.aware.DiscoverySession;
import android.os.Handler;
import android.os.Message;

public class MyObserver extends ContentObserver {
    /**
     * Creates a content observer.
     *
     * @param handler The handler to run {@link #onChange} on, or null if none.
     */
    Handler handler;

    public MyObserver(Handler handler)
    {
        super(handler);
    }

    @Override
    public void onChange(boolean selfChange) {
        super.onChange(selfChange);

        //向handler发送消息,更新查询记录
        Message msg = new Message();
        handler.sendMessage(msg);
    }
}
